/***************************************************************************
 * File name: EPubPageImp.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.01
 ***************************************************************************/
#ifndef _EPUB_PAGE_IMP_H_
#define _EPUB_PAGE_IMP_H_

#include "IEPubPage.h"
#include "EPubPagingImp.h"

class EPubPageImp : public IEPubPage
{
	friend class EPubPagingImp;
public:
	EPubPageImp(EPubPointer<IEPubMedia> mediaFile = NULL,
				EPUB_UInt32 pageIndex = 0,
				IEPubPage * prevPage = NULL,
				IEPubPage * nextPage = NULL)
		: m_MediaFile(mediaFile)
		, m_PageIndex(pageIndex)
		, m_PrevPage(prevPage)
		, m_NextPage(nextPage) { }

	virtual EPubPointer<IEPubMedia> GetMediaFile() const { return m_MediaFile; }
	virtual EPubPointer<IEPubPage> GetPrevPage() const { return m_PrevPage; }
	virtual EPubPointer<IEPubPage> GetNextPage() const { return m_NextPage; }
	virtual EPUB_UInt32 GetPageIndex() const { return m_PageIndex; }

	bool operator >(const EPubPageImp &other) const { return m_PageIndex > other.m_PageIndex; }
	bool operator <(const EPubPageImp &other) const { return m_PageIndex < other.m_PageIndex; }

private:
	EPubPointer<IEPubMedia>			m_MediaFile;
	IEPubPage *						m_PrevPage;
	IEPubPage *						m_NextPage;
	EPUB_UInt32						m_PageIndex;
};

#endif //_EPUB_PAGE_IMP_H_